package com.ysd.lis.service.emr.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ysd.common.Result;
import com.ysd.lis.entity.emr.EmrProcessDetailUser;
import com.ysd.lis.mapper.emr.EmrProcessDetailUserMapper;
import com.ysd.lis.service.emr.EmrProcessDetailUserService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wh
 * @since 2025-06-10
 */
@Service
public class EmrProcessDetailUserServiceImpl extends ServiceImpl<EmrProcessDetailUserMapper, EmrProcessDetailUser> implements EmrProcessDetailUserService {

    @Override
    public Result findDetailUserList(EmrProcessDetailUser processDetailUser) {
        List<EmrProcessDetailUser> list = this.list(new LambdaQueryWrapper<EmrProcessDetailUser>().eq(EmrProcessDetailUser::getProcessDetailId, processDetailUser.getProcessDetailId()).eq(EmrProcessDetailUser::getDelFlag, 0));
        return Result.succ(100, "查询成功", list);
    }

    @Override
    public Result addDetailUserList(List<EmrProcessDetailUser> processDetailUser) {
        boolean b = this.saveBatch(processDetailUser);
        if (b) {
            return Result.succ(1, "添加成功", null);
        }
        return Result.fail("添加失败");

    }
}
